﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Data.Mapping
{
    public partial class UserGuessPlayingHisMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<UserGuessPlayingHis>
    {
        public UserGuessPlayingHisMap()
        {
            ToTable("mc_UserGuessPlayingHis", "dbo");

            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.ConsumeRedDrill)
            .HasColumnName("ConsumeRedDrill")
          .HasPrecision(18, 6).IsRequired();
            Property(t => t.GetRedDrill)
          .HasColumnName("GetRedDrill")
        .HasPrecision(18, 6).IsOptional();
            HasRequired(t => t.Merchant)
               .WithMany()
               .HasForeignKey(d => d.UserId)
               .WillCascadeOnDelete(false);

            HasRequired(t => t.Playing)
               .WithMany(t => t.UserGuessPlayingHiss)
               .HasForeignKey(d => d.PlayingId)
               .WillCascadeOnDelete(false);

            HasRequired(t => t.GuessTeam)
               .WithMany()
               .HasForeignKey(d => d.GuessTeamId)
               .WillCascadeOnDelete(false);
        }
    }
}
